﻿using System;
using UniRx.Triggers;
using UnityEngine;

namespace UniRx.Examples
{
	// Token: 0x020001E4 RID: 484
	public class Sample02_ObservableTriggers : MonoBehaviour
	{
		// Token: 0x06000A28 RID: 2600 RVA: 0x00036B88 File Offset: 0x00034F88
		private void Start()
		{
			GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
			gameObject.AddComponent<ObservableUpdateTrigger>().UpdateAsObservable().SampleFrame(30, FrameCountType.Update).Subscribe(delegate(Unit x)
			{
				Debug.Log("cube");
			}, delegate()
			{
				Debug.Log("destroy");
			});
			UnityEngine.Object.Destroy(gameObject, 3f);
		}
	}
}
